package bma.common.langutil.ai.callback;

import bma.common.langutil.core.ToStringUtil;

/**
 * 
 * @author guanzhong
 * @since 1.0 (imported from BMA.ESP Project)
 * 
 * @param <RESP_TYPE>
 */
public class AIResultObject<RESP_TYPE> {

	private RESP_TYPE result;
	private Throwable throwable;

	public AIResultObject() {
		super();
	}

	public AIResultObject(RESP_TYPE result, Throwable throwable) {
		super();
		this.result = result;
		this.throwable = throwable;
	}

	public boolean isException() {
		return this.throwable != null;
	}

	public RESP_TYPE getResult() {
		return result;
	}

	public void setResult(RESP_TYPE result) {
		this.result = result;
	}

	public Throwable getThrowable() {
		return throwable;
	}

	public void setThrowable(Throwable throwable) {
		this.throwable = throwable;
	}

	@Override
	public String toString() {
		return ToStringUtil.fieldReflect(this);
	}

}
